//import java.util.Scanner;
//
//class Alg<T extends Comparable<T>>{
//    Object[] array;
//    public T max(T[] array){
//        int i = 0;
//        while (array[i + 1].compareTo(array[i]) > 0){
//            array[i] = array[i + 1];
//            i++;
//        }
//        return (T) array[i];
//    }
//}
//public class Main {
//    public static void main(String[] args) {
//
//    }
//}
import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;
class Person{
    private String name;
    private int age;

    public String getName(){
        return name;
    }
    public int getAge(){
        return age;
    }
    public void setName(String name){
        this.name = name;
    }
    public void setAge(int age){
        this.age = age;
    }
    public Person(String name,int age){
        this.name = name;
        this.age = age;
    }
    public Person(){

    }

    public  String toString(){
        return "Preson [name=" + name + ", age=" + age + "]";
    }
}

public class Main{
    public static void main(String args[]){
        List list = new ArrayList();
//        ArrayList<Person> list=new ArrayList<>();
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int i = 0; i < n; i++){
            Person p = new Person(sc.next(), sc.nextInt());
            list.add(p);
            System.out.println(p.toString());
        }
        String name = sc.next();
        int i;
        for (i = 0; i < list.size(); i++) {
            if(list.get(i).getClass().equals(name)){
                System.out.println(list.get(i).toString());
                break;
            }
        }
        if(i==list.size()) {
            System.out.println("此人不存在");
        }

    }
}

